# coding=utf-8
from django.shortcuts import render

from book.models import Book

# Create your views here.
def index(request):
    data = ("indel", "all", "one")
    return render(request, "book/index.html", context={"h1": "index", "data": data})


def all(request):
    book_all = Book.objects.all()
    return render(request, "book/all.html", context={"book_all": book_all})


def one(request, id):
    book_one = Book.objects.get(id=id)
    return render(request, "book/one.html", context={"book_one": book_one})